package routers

import (
    "net/http"

    "github.com/gin-gonic/gin"
)

type RouteUsercase struct
{
	r *gin.Engine
}

func (route * RouteUsercase) InitRoute() (r *gin.Engine) {
	// 创建路由
	route.r = gin.Default()
	// 设置根目录地址
	route.r.GET("/", func(c *gin.Context) {
		c.String(http.StatusOK, "This is Index Page")
	})
	// 拆分v1版本
	v1 := route.r.Group("/v1")
	{
		// 实现index路由
		IndexRoute(v1)
		// 实现user路由
		UserRoute(v1)
	}
	
	return route.r
}